package com.itlong.cloud.POJO.DTO.smartcard;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

/**
 * <desc>
 *      与旺龙一卡通对接-通行记录信息传输对象(用于存储通行记录信息数据进pull表最终推送给一卡通)
 * </desc>
 *
 * @createDate 2017-11-09
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SmartCardSyncDataPullRecordDTO implements Serializable{

    //用户手机
    private String userPhone;

    private String userEmail;

    //设备唯一码
    private String deviceUnique;

    //通行方式.
    private Integer passType;

    //通行时间.13位时间戳
    private String passTime;

    //设备类型
    private Integer deviceType;

    @JSONField(serialize = false, deserialize = false)
    public String getDataUid(){
        String phone = StringUtils.isBlank(userPhone)? "": userPhone;
        String email = StringUtils.isBlank(userEmail)? "":userEmail;
        return phone + email + passTime;
    }
}
